Skip to main content

Quick Start Push (CRM -> Merdeka)

This guide will help you, our EPC partner, connect quickly and securely so that your data flows seamlessly into Merdeka.
✅ Authenticate once
✅ Attach your credentials to each request
✅ Push project data (new or updated) — we’ll handle normalization and mapping for you.


Step 1 — Authenticate (Get Your Token)

Base URL Production (live):
https://api.merdeka.app/api/v1

Base URL Development (sandbox):
https://api-dev.merdeka.app/api/v1

Endpoint
POST /auth/email/login

Request Body

{
"email": "your-epc-user@example.com",
"password": "your-password"
}

Response

{ "token": "eyJhbGciOi..." }

👉 Save this token. You’ll need it for all requests.


Step 2 — Add Bearer Token + ClientID to All Requests

Each request must include headers:

Authorization: Bearer <your_token>
ClientID: <your_client_id>
Content-Type: application/json
  • Authorization → your token from Step 1
  • ClientID → The key will be provided to you by Merdeka

Step 3 — Push Data to Merdeka

Use this endpoint to transfer any new or updated project data from your CRM to Merdeka.

Endpoint

POST /externals/push

Payload Structure

  • id → Your unique identifier for the record in your CRM (e.g., Project ID)
  • data → Fields you want to send (we’ll map internally)

Example Request

{
"id": "PROJECT-1234",
"data": {
"customerName": "John Doe",
"customerEmail": "john.doe@example.com",
"customerPhone": "+1-555-0100",
"address": "123 Main St, Springfield, IL 62704",
"systemSizeKw": 6.5,
"financeType": "Loan",
"milestone": "Install Scheduled",
"salesRepName": "Jane Smith"
}
}
{
"id": "PROJECT-1235",
"data": {
"customer_name": "Jane Doe",
"customer_email": "john.doe@example.com",
"customer_phone": "+1-555-0100",
"full_address": "123 Main St, Springfield, IL 62704",
"system_size": 6.5
}
}

Notice that each example contains different payload content. As long as you follow the base payload structure (id and data), everything will work. Within the data object, you are free to use any field names or types that best suit your needs.


🛠️ Troubleshooting

  • 401 Unauthorized → Token missing or expired → Re-login.
  • 403 Forbidden → Missing/invalid ClientID → Check your ClientID.
  • 400 Bad Request → Invalid JSON or missing wrapper → Ensure payload matches:
{ "id": "...", "data": { ... } }

📨 Still unclear? Send us your payload and response — we’ll help you debug.


📝 Step by Step Overview

  1. Login/auth/email/login → copy token
  2. Headers → Add Authorization: Bearer <token> + ClientID: <ClientID>
  3. Push/externals/push with { "id": "<your-id>", "data": { ... } }
  4. Test using sandbox environment -> Send payload data to our sandbox environment first
  5. We do the mapping -> Once done we will let you know and you're good to use production credential
  6. Done! Integration are now ready in production

✅ That’s it — just send what you have, we’ll handle the mapping!